package com.bat.conf;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: springbootadmin可以不使用 spring-boot-starter-security
 * @Author: zpf
 * @Date: 2019/11/11 下午2:18
 */
@Configuration
@ConditionalOnClass(HttpSecurity.class)
public class SecurityPermitAllConfig implements WebMvcConfigurer {
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests().anyRequest().permitAll().and().csrf().disable();
    }
}
